<script>

export default {
  filters:{
    typeJSGC(val){
    const   type= {
    'JSGC':'建设工程',
    'ZFCG':'政府采购'
     }
      let str  = ''
      if(type[val]){
        str = type[val]
      }
      return str
    },
    typeRYLX(val){
    const   type= {
    'ZJ':'评标专家',
    'ZBDL':'招标代理',
    'JD':'甲方代表',
    'GZRY':'工作人员'
     }
      let str  = ''
      if(type[val]){
        str = type[val]
      }
      return str
    }
  },
  data() {
    return {
      form:{
 
        projectName:'',
        bidName:'',
        projectType:'JSGC',
        roomName:''

      },
      type:'项目'
    };
  },
  components: {
  },
  methods: {
    tools(num){
      const { projectId,bidId,projectName,bidName,roomId,floorName,personType,personId,personName} = this.form
      console.log('this.form',this.form)
      switch(num){
        case 1:
          this.$router.push({path:'/pageTrack',query:{projectId,bidId,projectName,bidName,floorName}})
          break;
        case 2:
          this.$router.push({path:'/dp1',query:{projectId,bidId,pbRoomId:roomId,projectName,floorName}})
          break;
        case 3:
          // 查看人员信息 --- 没有项目
          this.$router.push({path:'/pageTrack',query:{projectId,bidId,projectName,bidName,roomId,floorName,personType,personId,personName}})
          break;

      }
    },
    setMsg(data,type){
      this.type = type
      this.form = data
      
    }
  }
};
</script>
<template>
   <div class="dialog-content"   v-if="$attrs.visible">
      <ul v-if="type === '项目'">
        <li><span>项目名称：</span><p>{{ form.projectName }}</p></li>
        <li><span>标段名称：</span><p>{{ form.bidName }}</p></li>
        <li><span>项目类型：</span><p>{{form.projectType | typeJSGC }}</p></li>
        <li><span>当前标室：</span><p>{{ form.roomName }}</p></li>
        <li><span>操作：</span><button class="jfbutton" @click="tools(1)">查看轨迹</button><button  @click="tools(2)" class="jfbutton" style="margin-left: 10px;">查看监控</button></li>
      </ul>
      <ul v-if="type ==='人员'">
        <li><span>人员姓名：</span><p>{{ form.personName }}</p></li>
        <li><span>参与项目：</span><p>{{ form.projectName }}</p></li>
        <li><span>人员类型：</span><p>{{ form.personType | typeRYLX }}</p></li>
        <li><span>身份卡号：</span><p>{{ form.cardId }}</p></li>
        <li><span>操作：</span><button class="jfbutton"  @click="tools(3)">查看轨迹</button></li>
      </ul>
   </div>
</template>
<style scoped lang="scss">
.dialog-content{
  position: absolute;
  top: 100px;
  left: 50%;
  margin-left: -180px;
  width: 360px;
  background-color: #0422607a;
  border: #05389ffd 1px solid ;
  padding: 10px 12px;
  box-sizing: border-box;
  color: #c5c5c5;
  li{
    display: flex;
    line-height: 26px;
    p {
  word-wrap: break-word; /* 允许长单词或 URL 换行 */
  overflow-wrap: break-word; /* 同 word-wrap */
}
  }
  li>span{
    min-width: 80px;
    // text-align: justify;
    width: 80px;
  }
  .jfbutton{
   background-color: #4395FF;
   color: #fff;
   font-size: 12px;
   border: 2px solid #4395FF;
   border-radius: 2px;
 }
}
</style>
